package br.com.unifor.dctree.dc;

import java.util.Set;

public class DCTree {

	private Set<DCEntry> children;
	private DCNode head;
	private int bfactor;
	private float s1;
	private float s2;
	private int minchild;
	
	
	public DCTree(int bfactor, float s1, float s2, int minchild){
		this.setBfactor(bfactor);
		this.setS1(s1);
		this.setS2(s2);
		this.setMinchild(minchild);
	}
	
	public void addDoc(Document doc){
		//III 1 says if new entry similarity with leaf > s2
		//merge entry with leaf
		
		//According to III A 1, it must be done recursively to the closest
		//child node with similarity value higher than s1
		//if one doesn't exist, create a new empty node
		//if there is no empty entry, split the node
	}
	
	public void addDoc(DocumentCluster dc){
		//if new entry similarity with this.child > s1
		//add entry to child node
	}
	
	public void remNode(DCEntry node){
		
	}
	
	
	public void remDoc(Document doc){
		this.children.remove(doc);
	}
	
	
	public void remDoc(DocumentCluster dc){
		//III C
		//Find the node with this dc
		//Check if the number of children is > minchild
		//Remove the Cluster
		//Else merge node with sibling 
		
		this.children.remove(dc);
	}

	public DCEntry getHead() {
		return head;
	}

	public void setHead(DCEntry head) {
		this.head = head;
	}

	public int getBfactor() {
		return bfactor;
	}

	public void setBfactor(int bfactor) {
		this.bfactor = bfactor;
	}

	public float getS1() {
		return s1;
	}

	public void setS1(float s1) {
		this.s1 = s1;
	}

	public float getS2() {
		return s2;
	}

	public void setS2(float s2) {
		this.s2 = s2;
	}

	public int getMinchild() {
		return minchild;
	}

	public void setMinchild(int minchild) {
		this.minchild = minchild;
	}
	

	
}
